<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>分享问卷</title>
    <style>
        body {
            background-color: rgb(179, 216, 212);
        }

        #lay {
            max-width: 750px;
            padding: 20px 50px;
            background-color: white;
            margin: auto;
        }
    </style>
</head>

<body>
    <div id="lay">
        <form action="javascript:;" id="myform">
            <div>
                <div style="font-size: 22px;text-align: center;font-weight: bold;">{{name}}</div>
                <div style="text-align: center;">{{remark}}</div>
                <input type="hidden" name="id" value="{{id}}">
                <ol>
                    {% for item in optionList%}
                    <li style="padding: 8px;">
                        <span>{{item.name}}</span>
                        <span>
                            <select name="score{{item.id}}" id="">
                                <option value="1">1</option>
                                <option value="2">2</option>
                                <option value="3">3</option>
                                <option value="4">4</option>
                                <option value="5">5</option>
                                <option value="6">6</option>
                                <option value="7">7</option>
                                <option value="8">8</option>
                                <option value="9">9</option>
                                <option value="10">10</option>
                            </select>
                        </span>
                    </li>
                    {% endfor %}
                </ol>

                <div><button onclick="submitBtn()">提交</button></div>
            </div>
        </form>


    </div>
    <script src="js/jquery-3.6.0.min.js"></script>
    <script src="https://cdn.bootcss.com/axios/0.18.0/axios.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script>
        function submitBtn() {
            axios({
                method: 'post',
                url: '/fillscore',
                data: $('#myform').serialize()
            })
                .then(res => {
                    res = res.data
                    if (res.code = 200) {
                        alert('提交问卷成功')

                    }
                })
                .catch(err => {
                    console.log(err);
                })
        }

    </script>
</body>

</html>